status = -1;
var itemList = Array(5000529, 5000000, 5000001, 5000002, 5000003, 5000004);

function start() {
    action(1, 0, 0)
}

function action(g, d, c) {
    if (g == 1) {
        status++
    } else {
        if (g == 0 && status == 0) {
            im.dispose();
            return
        }
        status--
    }
    if (status == 0) {
        var f = "";
        for (var b = 0; b < itemList.length; b++) {
            f += "#L" + b + "##v" + itemList[b] + "##z" + itemList[b] + "##l\r\n"
        }
        im.askMenu("请选择你要的：\r\n#r" + f)
    } else {
        if (status == 1) {
            var e = itemList[c];
            var a = Math.floor(Math.random() * 1 + 1);
            im.gainPet(e, "我爱BMS", 15, 1642, 100, 0, -100);
            im.gainItem(2432554, -1);
            im.sendOk("恭喜您，获得了" + a + "个#b#z" + e + "#");
            im.dispose()
        }
    }
}
var status = -1;